"""
Apache Tika 服务配置
"""

import os
from typing import Optional
from pydantic_settings import BaseSettings


class TikaConfig(BaseSettings):
    """Tika 服务配置"""
    
    # Tika 服务器地址
    # tika_server_url: str = os.getenv("TIKA_SERVER_URL", "http://localhost:9998")
    tika_server_url: str = os.getenv("TIKA_SERVER_URL", "http://101.126.54.157:7581")
    # 请求超时时间（秒）
    tika_timeout: int = int(os.getenv("TIKA_TIMEOUT", "60"))
    
    # 是否启用元数据提取
    extract_metadata: bool = os.getenv("TIKA_EXTRACT_METADATA", "false").lower() == "true"
    
    class Config:
        env_file = ".env"
        env_file_encoding = "utf-8"



